using System;
using System.Collections.Generic;
using System.Text;

namespace Sedodream.Sudoku.Board
{
	/// <summary>
	/// Interface to all Sudoku boards.
	/// </summary>
	public interface IBoard
	{
		/// <summary>
		/// Gets the board data associated with this board.
		/// </summary>
		IBoardData BoardData
		{
			get;
		}
		/// <summary>
		/// Gets the columns for this board.
		/// </summary>
		IDictionary<int, ICellGroup> Columns
		{
			get;
		}
		/// <summary>
		/// Gets the rows for this board.
		/// </summary>
		IDictionary<int, ICellGroup> Rows
		{
			get;
		}
		/// <summary>
		/// Gets the squares for this board.
		/// </summary>
		IDictionary<int, ICellGroup> Squares
		{
			get;
		}
		/// <summary>
		/// Gets all the cells for this board
		/// </summary>
		ICell[,] Cells
		{
			get;
		}
		/// <summary>
		/// Returns the cell at (row,col).
		/// </summary>
		/// <returns></returns>
		ICell this[int row, int col]
		{
			get;
		}
		/// <summary>
		/// Gets the state of the board.
		/// </summary>
		BoardState State
		{
			get;
			set;
		}
		/// <summary>
		/// Method to call to update the state of this board from the data contained
		/// within it.
		/// </summary>
		void UpdateBoardState();
		/// <summary>
		/// Finds all the <c>ICellGroup</c>s containing the location
		/// specified.
		/// </summary>
		IList<ICellGroup> FindAllGroupsContaining(IPoint location);
		/// <summary>
		/// Sets the value of the cell at <c>Location</c> the the value
		/// in <c>value</c>.
		/// </summary>
		void SetValueAt(IPoint location, int? value);
		/// <summary>
		/// Will determine if the value provided is valid for the
		/// given location.
		/// </summary>
		bool IsValueValid(IPoint location, int value);
		/// <summary>
		/// Determine if the move is valid on the current board
		/// </summary>
		bool IsMoveValid(IMove move);
		/// <summary>
		/// This will find and return all the moves available in the board.
		/// </summary>
		List<IMove> FindAllMoves();
	}
}
